namespace DesignPattern.Structural.Composite
{
    public class CompositePattern
    {
        public static void Test()
        {
            var root = new Branch("root");
            var branchA = new Branch("A");
            var branchB = new Branch("B");
            root.Add(branchA);
            root.Add(branchB);

            var leafA1 = new Leaf("A1");
            var leafA2 = new Leaf("A2");
            var leafB1 = new Leaf("B1");
            var branchB2 = new Branch("B2");
            branchA.Add(leafA1);
            branchA.Add(leafA2);
            branchB.Add(leafB1);
            branchB.Add(branchB2);

            root.Display(1);
        }
    }
}